package com.snail.model.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author cici
 * @description 作品集合
 * @date 2025/8/21 19:26
 */
@Data
@Document(indexName = "biz_collection")
public class Collection {
    @Id
    @Field(name = "id", type = FieldType.Long)
    @JsonProperty("id")
    private Long id;

    @Field(name = "user_id", type = FieldType.Long)
    @JsonProperty("user_id")
    private Long userId;

    @Field(name = "works_name", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("works_name")
    private String worksName;

    @Field(name = "name", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("name")
    private String name;

    @Field(name = "description", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("description")
    private String description;

    @Field(name = "work_description", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("work_description")
    private String workDescription;

    @Field(name = "cover_url", type = FieldType.Keyword)
    @JsonProperty("cover_url")
    private String coverUrl;

    @Field(name = "cover_file_url", type = FieldType.Keyword)
    @JsonProperty("cover_file_url")
    private String coverFileUrl;

    @Field(name = "file_md5", type = FieldType.Keyword)
    @JsonProperty("file_md5")
    private String fileMd5;

    @Field(name = "sort_order", type = FieldType.Integer)
    @JsonProperty("sort_order")
    private Integer sortOrder;

    @Field(name = "status", type = FieldType.Integer)
    @JsonProperty("status")
    private Integer status;

    @Field(name = "create_time", type = FieldType.Date)
    @JsonProperty("create_time")
    private Date createTime;

    @Field(name = "update_time", type = FieldType.Date)
    @JsonProperty("update_time")
    private Date updateTime;

    @Field(name = "type", type = FieldType.Keyword)
    @JsonProperty("type")
    private String type;
}
